<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <div th:replace="admin/head :: head"></div>

    <title>系统设置列表</title>


</head>

<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a th:href="@{/admin}">首页</a>
        <a>
          <cite>系统设置列表</cite>
        </a>
      </span>
</div>
<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" th:action="@{/admin/sysconfig/list}" method="get" id="searchForm">
            <input type="text" name="type" th:value="${sysConfig.type}" placeholder="类型" autocomplete="off" class="layui-input">

            <input type="text" name="column" th:value="${sysConfig.column}" placeholder="属性" autocomplete="off" class="layui-input">

            <input type="text" name="description" th:value="${sysConfig.description}" placeholder="描述" autocomplete="off" class="layui-input">

            <button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
    </div>
    <xblock>
        <button class="layui-btn layui-btn-danger" onclick="del('/admin/sysconfig/delete/')"><i class="layui-icon"></i>批量删除
        </button>
        <button class="layui-btn" onclick="x_admin_show('添加设置','/admin/sysconfig/form')"><i class="layui-icon"></i>添加
        </button>
        <a class="layui-btn layui-btn-small" href="javascript:location.replace(location.href);" title="刷新">
            <i class="layui-icon">ဂ</i>
        </a>
        <span class="x-right" style="line-height:40px" th:text="|共有数据: ${sysConfigList.size()} 条|"></span>
    </xblock>
    <table class="layui-table">
        <thead>
        <tr>
            <th>
                <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i
                        class="layui-icon">&#xe605;</i></div>
            </th>
            <th>编号</th>
            <th>类型</th>
            <th>描述</th>
            <th>设置名称</th>
            <th>参数</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="item:${sysConfigList}">
            <td>
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary" th:attr="data-id=${item.id}"><i
                        class="layui-icon">&#xe605;</i>
                </div>
            </td>
            <td th:text="${item.id}"></td>
            <td th:text="${item.type}"></td>
            <td th:text="${item.description}"></td>
            <td th:text="${item.column}"></td>
            <td th:text="${item.value.length() > 30 ? (#strings.substring(item.value,0,30)) + '...' : item.value}"></td>
            <td class="td-manage">
                <a title="查看" th:onclick="'x_admin_show(\'编辑\',\'/admin/sysconfig/form?id=' + ${item.id} + '\')'"
                   href="javascript:;">
                    <i class="layui-icon">&#xe63c;</i>
                </a>
                <a title="删除" th:onclick="'del(\'/admin/sysconfig/delete/\', ' + ${item.id} + ')'" href="javascript:;">
                    <i class="layui-icon">&#xe640;</i>
                </a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
<script th:inline="javascript">
    layui.use('form', function () {
        var form = layui.form;

        form.on('submit(search)', function(data) {
            this.submit();
        })
    });

</script>
</body>

</html>